#!/bin/sh

[ "x$IFACE" = "xlo" ] && exit 0
[ "x$IFACE" = "x--all" ] && exit 0
grep -Eq "^#?\s*iface\s+${IFACE}\s+inet6\s+.*$" /etc/network/interfaces && exit 0

if [ -f /var/run/odhcp6c.${IFACE}.pid ]; then
    pid=$(cat /var/run/odhcp6c.${IFACE}.pid)
    kill -9 "$pid" 2>/dev/null
fi

exit 0
